package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.upload.UploadQrcodeBo;
import com.zhuss.bean.bo.core.user.CareUserRoleListBo;
import com.zhuss.bean.bo.core.user.DetailUserBo;
import com.zhuss.bean.bo.core.user.SearchUserBo;
import com.zhuss.bean.vo.core.upload.UploadVo;
import com.zhuss.common.AbstractBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.Processor;
import com.zhuss.common.ReadService;
import com.zhuss.core.processor.UserRead;
import com.zhuss.core.user.UserReadServiceExt;
import com.zhuss.exception.OceanException;


/**
 * 权限点查询 controller
 * @Author zhushanshuo
   @Date 2019-11-27 19:58
 *
 */
  
 
@RestController
@RequestMapping("/user")
public class UserReadController extends BaseController {
	
	@Autowired
	@Qualifier("userReadService")
	private ReadService<Object, Object> userReadService;
	
	@Autowired
	@Qualifier("userReadServiceExt")
	private UserReadServiceExt userReadServiceExt;
	
	@Autowired
	private UserRead userRead;
	
	@Autowired
	@Qualifier("uploadQrcodeProcessor")
	private Processor<UploadVo, UploadQrcodeBo> uploadQrcodeProcessor;
	
	/**
	 * 详情
	 * @param bo
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
	@RequestMapping("/detail")
    public Object detail(@RequestBody DetailUserBo bo) throws OceanException {
		
		Object result = userReadService.detail(bo);
		return result;
    }
	
	/**
	 * 列表
	 * @param bo
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchUserBo bo) throws OceanException {
		
		Object result = userReadService.list(bo);
		return result;
    }
	
	
	/**
	 * 查询用户的角色信息
	 * @param bo
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
	@RequestMapping("/careUserRoleList")
    public Object careUserRoleList(@RequestBody CareUserRoleListBo bo) throws OceanException {
		
		Object result = userReadServiceExt.careUserRoleList(bo);
		return result;
    }
	
	/**
	 * test
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
	@RequestMapping("/test")
    public Object test(@RequestBody AbstractBo bo) throws OceanException {
		
		return null;
    }
	
	


	
}
